<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>计算圆的周长和面积</title>
</head>
<body>

<input type="text" placeholder="半径" id="a">
<input type="text" placeholder="周长" id="b">
<input type="text" placeholder="面积" id="c">

<script>

    //根据圆的半径
    var p = Math.PI;
    var n = prompt("请输入圆的半径");
    n = Number(n);
    //圆的周长
    var c = 2*p*n;
    //圆的面积
    var d = p*n*n;

    console.log(n);
    console.log(c);
    console.log(d);

    document.querySelector("#a").value = n;
    document.querySelector("#b").value = c;
    document.querySelector("#c").value = d;


</script>


</body>
</html>